const expree = require('express')
const app = expree()
const cors = require('cors')

app.use(cors())
app.use(expree.static('static'))
const baseURL = 'http://localhost:3000'
const listen = 3000

// 引入方法
const { getHomeApi } = require('./api/homeApi')

app.get('/', (req, res) => {
  res.send('Hello World!')
})

app.get('/api/destination/home', (req, res, baseURL = 'http://localhost:3000') => {
  getHomeApi(req, res)
})

app.listen(listen, () => {
  console.log(`Example app listening at http://localhost:${listen}`)
})
